package edu.towson.greenteam.offer;
import junit.framework.Assert;

import org.junit.Test;

import edu.towson.greenteam.Iterator;



public class OfferTest {

	@Test
	public void test() {
		Offer o1 = new Offer("20OFF", 20, 99);
		Assert.assertEquals("True", 20, o1.getOfferAmt());
	}
	
	public void testOfferItr()
	{
		Offer o1 = new Offer("20Off", 20, 99);
		Offer o2 = new Offer("20Off", 20, 99);
		Offer o3 = new Offer("20Off", 20, 99);
		
		Offers offersInstance = new Offers();
		offersInstance.add(o1);
		offersInstance.add(o2);
		offersInstance.add(o3);
		
		Iterator<Offer> itr = offersInstance.getItr();
		int count = 0;
		while (itr.hasNext())
		{
			Offer currentOffer = itr.next();
			Assert.assertEquals(currentOffer.getDescription(), "20Off");
			count++;
		}
		Assert.assertEquals(count, 3);
	}

}